<template>
  <TableformModal ref="form" :iProps="iProps" :genConfigId="genConfigId" :objCode="objCode" @setProp="setProp" @setGenConfigId="setGenConfigId"/>
</template>

<script>

  import TableformModal from '../TableformModal'
  import { getAction, httpAction } from '@/api/manage'
  export default {
    name: 'Step0',
    components: { TableformModal },
    props: {
      iProps: {
        type: Object,
        default: () => {
        }
      },
      genConfigId:{
        type:String,
        default:""
      },
      objCode:{
        type:String,
        default:""
      }
    },
    data () {
      return {
        url:{
          saveGentableAndTableRelation: "/gentable/sysGenTable/saveGenTableAndTableRelation",
        }
      }
    },
    methods: {
      setProp (key, value) {
        this.$emit('setProp', key, value)
      },
      prevStep () {
        this.$emit('prevStep')
      },
      nextStep () {
        this.save().then(
          () => this.$emit('nextStep')
        ).catch(function(error) {
          //console.log(error)
          // 处理前两个回调函数的错误
        });
      },
      save(){
        return this.$refs.form.save()
      },
      finish () {
        this.handleOk().then(() => this.$emit('finish'))
      },
      show () {
        // this.$refs.obj.searchReset()
      },
      setGenConfigId(genConfigId){
        this.$emit("setGenConfigId",genConfigId);
      },

    }
  }
</script>
